import * as apis from 'services/admin'
import * as types from '../mutation-types'

const state = {
  list: [],
}

const actions = {
  async getAdminList({ commit }) {
    const data = await apis.getAdminList()
    commit(types.GET_ADMIN_LIST_SUCCESS, data)
  },
}

const mutations = {
  [types.GET_ADMIN_LIST_SUCCESS](state, data) {
    console.log(data)
    state.list = data
  },
}

export default {
  state,
  actions,
  mutations,
}
